home *** CD-ROM | disk | FTP | other *** search
- package com.sun.java.swing.plaf.basic;
-
- import java.beans.PropertyChangeEvent;
- import java.beans.PropertyChangeListener;
-
- public class BasicComboBoxUI$ComboBoxPropertyChangeListener implements PropertyChangeListener {
- // $FF: synthetic field
- BasicComboBoxUI this$0;
-
- public void propertyChange(PropertyChangeEvent e) {
- String propertyName = e.getPropertyName();
- if (propertyName.equals("model")) {
- if (this.this$0.listBox != null) {
- this.this$0.listBox.setModel(this.this$0.comboBox.getModel());
- if (this.this$0.popupIsVisible()) {
- this.this$0.popup.hide();
- }
- }
- } else if (propertyName.equals("editor") && this.this$0.comboBox.isEditable()) {
- this.this$0.removeEditor();
- this.this$0.addEditor();
- } else if (propertyName.equals("editable")) {
- if (this.this$0.comboBox.isEditable()) {
- this.this$0.comboBox.setRequestFocusEnabled(false);
- this.this$0.comboBox.removeKeyListener(this.this$0.popupKeyListener);
- this.this$0.addEditor();
- } else {
- this.this$0.comboBox.setRequestFocusEnabled(true);
- this.this$0.comboBox.addKeyListener(this.this$0.popupKeyListener);
- this.this$0.removeEditor();
- }
- } else if (propertyName.equals("enabled")) {
- boolean cbIsEnabled = this.this$0.comboBox.isEnabled();
- if (cbIsEnabled) {
- if (this.this$0.editor != null) {
- this.this$0.editor.setEnabled(true);
- }
-
- if (this.this$0.arrowButton != null) {
- this.this$0.arrowButton.setEnabled(true);
- }
- } else {
- if (this.this$0.editor != null) {
- this.this$0.editor.setEnabled(false);
- }
-
- if (this.this$0.arrowButton != null) {
- this.this$0.arrowButton.setEnabled(false);
- }
- }
-
- this.this$0.comboBox.repaint();
- } else if (propertyName.equals("maximumRowCount") && this.this$0.popupIsVisible()) {
- this.this$0.popup.hide();
- this.this$0.popup.show();
- }
-
- }
-
- // $FF: synthetic method
- public BasicComboBoxUI$ComboBoxPropertyChangeListener(BasicComboBoxUI this$0) {
- this.this$0 = this$0;
- }
- }
-